package com.lx.demo2;

public class UserServiceImplProxy implements UserService{

    private UserServiceImpl userService;

    public void setUserService(UserServiceImpl userService) {
        this.userService = userService;
    }

    @Override
    public void add() {
        log("新增");
        userService.add();
    }

    @Override
    public void delete() {
        log("删除");
        userService.delete();
    }

    @Override
    public void update() {
        log("修改");
        userService.update();
    }

    @Override
    public void query() {
        log("查询");
        userService.query();
    }

    public void log(String method){
        System.out.println("执行了" + method + "方法");
    }
}
